<%@include file="taglib_includes.jsp" %>
<html>
<head>
<title><spring:message code="Add.Student.Title"></spring:message></title>

<style type="text/css">
tr.even { background: #CCC; }
tr.odd { background: #EEE; }

</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript">


</script>



</head>
<body>
<table  bgcolor="white" width="1200" height="300" align="center" style="border-collapse: collapse;" border="1" bordercolor="#006699" >
	<form:form action="addStudent" method="post" commandName="add_student" modelAttribute="studentForm">
	<tr>
		<td align="center" style="background-color: lightblue"><h3>Add Student</h3></td>
	</tr>
	<tr align="left">
 				<td align="left">
 				<input type="button" id="addrows" name="addrows" class="addperson" value="Add Rows">
 				
 				
 				
 				<input type="button" id="removerows" class="removerows" value="Delete Rows" />	
 				
 				<input type="submit" value="Save" />
 				</td>		
 				</tr>
	<tr valign="middle" align="center">
	
	<td align="center" valign="middle">
	
 		

 			<table width="1200" height="200" style="border-collapse: collapse;" border="0" bordercolor="#006699" cellspacing="0" cellpadding="0">
 				
 				<thead>
 				
 				<tr height="1" bgcolor="lightblue">
 					<th colspan="1">
 						No
 					</th>
 					<th width="5">
 						Select
 					</th>
 					<th>
 						Reg No
 					</th>
 					<th>
 						First Name
 					</th>
 					
 					<th>
 						Last Name
 					</th>
 					
 					<th>
 						Sex
 					</th>
 					
 					<th>
 						DOB
 					</th>
 					
 					<th>
 						DOJ
 					</th>
 					
 					<th>
 						Dept Name
 					</th>
 					
 					<th>
 						Role Name
 					</th>
 					<th>
 						Batch Name
 					</th>
 					
 					<th>
 						Status
 					</th>
 					
 				</tr>
 				</thead>
 				<tbody>
 				<c:forEach var="rows" items="${studentForm.studentList}" varStatus="status">
 				<tr class="${status.index % 2 == 0 ? 'even' : 'odd'}"  >
 					
 					<td width="15">
 						<b>${status.count}</b>
 					</td>
 					
 					<td width="10">
 						<form:checkbox path="studentList[${status.index}].select"/>
 					</td>
 					
 					<td><form:input  path="studentList[${status.index}].regNo"/></td>
 					
 					<td><form:input  path="studentList[${status.index}].firstName"/></td>
 					
 					
 					<td><form:input  path="studentList[${status.index}].lastName"/></td>
 					
 					
 					<td><form:select  path="studentList[${status.index}].sex">
						<form:option value="NONE" label="--- Select ---"/>
						<form:option value="M" label="Male"/>
						<form:option value="F" label="Female"/>
						</form:select></td>
 					
 					
 					<td><form:input  path="studentList[${status.index}].dob"/></td>
 					
 					
 					<td><form:input  path="studentList[${status.index}].doj"/></td>
 					
 					
 					<td><form:select  path="studentList[${status.index}].deptName">
						<form:option value="NONE" label="--- Select ---"/>
						<form:options items="${deptlist}" />
						</form:select></td>
 					
 					
 					<td><form:select  path="studentList[${status.index}].roleName">
						<form:option value="NONE" label="--- Select ---"/>
						<form:option value="ROLE_STUDENT" label="Student"/>
						<form:option value="ROLE_BATCHREP" label="Batch Rep"/>
						</form:select></td>
 					
 					
 					<td><form:select  path="studentList[${status.index}].batchName">
						<form:option value="NONE" label="--- Select ---"/>
						<form:options items="${batchList}" />
						</form:select>
						
 					</td>
 					
 					
 					<td><form:select  path="studentList[${status.index}].status">
						<form:option value="NONE" label="--- Select ---"/>
						<form:option value="E" label="Enable"/>
						<form:option value="D" label="Disable"/>
						</form:select></td>
						
 				</tr>
					</c:forEach>
					
						</tbody>
 			</table>
 			
 			</td>
 			</tr>
 			<tr align="center">
						<td width="100" align="center"><B>
						${savedMsg}
						</B>
						</td>
						</tr>	
 		
 	
 		</form:form>
 		
</table>

	
	
	
</body>
</html>